package thinkingJava.chapter18;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

public class BinaryFile {
	public static byte[] read(File bFile) throws IOException {
		BufferedInputStream bis = new BufferedInputStream(new FileInputStream(bFile));
		try {
			byte[] data = new byte[bis.available()];
			bis.read(data);
			return data;
		} finally {
			bis.close();
		}
	}
	public static byte[] read(String filename) throws IOException {
		return read(new File(filename).getAbsoluteFile());
	}
}
